#include<iostream>
#include<cstring>
#include<string>

struct Student
{
    void print()
    {
        std::cout<<id<<" "<<name<<std::endl;
    }
    int id;
    std::string name;
};

int main()
{
    //结构体名可以直接作为类型名
    Student s= {1,"zhangsan"};
    std::cout<<s.id<<" "<<s.name<<std::endl;
    s.print();   //函数也成为了结构体成员
    return 0;
}